
class_name XiaoShiMei


static func CreateCardData() -> CardData:
	var data = CardData.new()
	
	data.attack = 30
	data.hp = 240
	data.maxHp = data.hp
	data.defence = 10
	data.speed = 8
	
	data.cardName = "小师妹"
	data.cardDesc = "为生命值最低的友方\n恢复生命值"
	data.image = load("res://texture/Role/小师妹.png")
	
	return data


static func GetMinHpRole():
	
	var fightManager = FightManager.Inst
	
	var hp = 999999;
	var ret;
	
	for i in range(fightManager.playerCards.size()):
		var role: Card = fightManager.playerCards[i]
		if role.data.hp < hp:
			ret = role
			hp = role.data.hp
			
	return ret;


static func CreateCard() -> Card:
	var cardprefab = load("res://prefab/card.tscn")
	var card: Card = cardprefab.instantiate()
	
	var data: CardData = CreateCardData()
	data.onAttack = func (targets: Array):
		
		var role: Card = GetMinHpRole(); 
		role.data.onCure.call(data.attack)
		role.runCureAnim(data.attack)
		
		data.lastAttackTime = Time.get_ticks_msec()

	
	card.setData(data)
	
	return card
	


	
